<style media="screen">
	.confirm-box{
		width: 300px;
		height: 230px;
		background-color: #FFF;
		position: fixed;
		top: -100%;
		left: 50%;
		border: 2px solid #ebeef5;
		border-radius: 10px;
		box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
		padding: 15px;
		z-index: 1000;
		transition:top .2s;
	}
	@media screen and (max-width: 930px) {
	    .confirm-box {
	        width: 80%;
			left: 10%;
	    }
	}
</style>

<div class="row">
	<div class="col-md-12">
		<div class="box box-info">
			<div class="box-header with-border">
				<h3 class="box-title">进度</h3>
			</div>
			<div class="box-body">
				@foreach($CT as $k => $v)
					<h4 class="box-title">
						{{trans("admin.".$k."_plan.header")}}:
					</h4>
					@foreach($v as $ke => $va)
					<li style="text-indent:2rem;font-size:16px;">
						@if($k == "reading")
							@if(isset($va['title']))
								@if ($va['title'] == "A to Z")
									{{$va['title']}}：{{$va['atoz']}}，({{$va['num']}}篇)
								@else
									{{$va['title']}}：{{$va['chapters']}}
								@endif
							@else
								该月阅读计划完成率:{{$va['percent']}}%
							@endif
						@else
							{{$va['title']}}：
							@if($va['book'])
							<p style="text-indent:6rem;">
								教材——{{$va['book']}}
							</p>
							@endif
							@if($va['chapter'])
							<p style="text-indent:6rem;">
								章节——{{$va['chapter']}}
							</p>
							@endif
							@if($va['desc'])
							<p style="text-indent:6rem;">
								知识点——{{$va['desc']}}
							</p>
							@endif
							@if(isset($va['other_zhishi_title']))
								@if($va['other_zhishi_title'])
								<p style="text-indent:6rem;">
									额外知识点——{{implode(',',$va['other_zhishi_title'])}}
								</p>
								@endif
							@endif
						@endif
					</li>
					@endforeach
				@endforeach
			</div>
		</div>
	</div>
</div>

<p class="text-center">
	<button type="button" name="button" class="btn btn-danger" onclick="confirmBox.methods.show()">重新填写</button>
</p>

<div class="confirm-box">
	<p style="margin:0;padding:0;height:120px;line-height:120px;text-align:center;">
		<i class="fa fa-exclamation-triangle" style="font-size:64px;height:120px;line-height:120px;color:#E6A23C"></i>
	</p>
	<p style="margin:0;padding:0;height:40px;line-height:40px;text-align:center;color:#F56C6C;font-size:16px;font-weight:500;">
		重新填写会清除原数据，是否继续？
	</p>
	<p style="margin:0;padding:0;height:40px;line-height:40px;text-align:center;">
		<button class="btn btn-samll btn-default" onclick="confirmBox.methods.cancel()">取消</button>
		<button class="btn btn-samll btn-warning" onclick="confirmBox.methods.confirm()">确认</button>
	</p>
</div>
<div class="confirm-mask"></div>
<script type="text/javascript">
var confirmBox = {
	el:$(".confirm-box"),
	methods:{
		cancel:function() {
			confirmBox.el.css({"top":"-100%"})
		},
		show:function() {
			confirmBox.el.css({"top":"30%"})
			setTimeout(function() {
				confirmBox.el.css({"top":"25%"})
			},200)
		},
		confirm:function() {
			let url = "{{URL::asset('admin/study_jindu_confirm_form/clear_record')}}";
			$.post(url,{_token:"{{csrf_token()}}",notice_id:"{{$ID}}"},function(res) {
				if(res.code != 1){
					alert(res.msg);
				}else{
					window.location.reload();
				}
			});
		}
	}
}
</script>
